package rexsee.core.browser.clazz;

import java.util.ArrayList;

import rexsee.core.browser.Browser;
import android.content.Context;

public class PageReadyListeners {
	private final ArrayList<PageReadyListener> listeners;
	public PageReadyListeners() {
		listeners = new ArrayList<PageReadyListener>();
	}
	public void add(PageReadyListener listner) {
		listeners.add(listner);
	}
	public void remove(PageReadyListener listner) {
		listeners.remove(listner);
	}
	public void clear() {
		listeners.clear();
	}
	public void run(Context context, Browser browser, String url) {
		for (int i = 0; i < listeners.size(); i++)
			listeners.get(i).run(context, browser, url);
	}
	public static abstract class PageReadyListener {
		public abstract void run(Context context, Browser browser, String url);
	}
}
